﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ui="clr-namespace:CannedBytes.CommandLineGui.UI">

    <Style TargetType="Button">
        <Setter Property="Margin" Value="2,2,2,2" />
        <Setter Property="HorizontalAlignment" Value="Left" />
    </Style>

    <Style TargetType="ui:DropDownButton">
        <Setter Property="Margin" Value="2,2,2,2" />
    </Style>

    <Style TargetType="CheckBox">
        <Setter Property="Margin" Value="2,2,2,2" />
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

    <Style TargetType="RadioButton">
        <Setter Property="Margin" Value="2,2,2,2" />
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

    <Style TargetType="Label">
        <Setter Property="Margin" Value="2,2,2,2" />
    </Style>

    <Style TargetType="TextBox">
        <Setter Property="Margin" Value="2,2,2,2" />
    </Style>

    <Style TargetType="ComboBox">
        <Setter Property="Margin" Value="2,2,2,2" />
    </Style>

    <Style TargetType="GroupBox">
        <Setter Property="Margin" Value="2,2,2,2" />
    </Style>

    <Style TargetType="ListBox">
        <Setter Property="Margin" Value="2,2,2,2" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    </Style>

    <Style TargetType="ListBoxItem">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    </Style>

    <Style TargetType="Image">
        <Setter Property="Width" Value="22" />
        <Setter Property="Height" Value="22" />
    </Style>

    <Style x:Key="ValidationImage" TargetType="{x:Type Image}">
        <Setter Property="Width" Value="22" />
        <Setter Property="Height" Value="22" />
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate />
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.ValidationAdornerSiteFor).(Validation.HasError)}" Value="True">
                <Setter Property="Visibility" Value="Visible" />
                <Setter Property="ToolTip"
                        Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.ValidationAdornerSiteFor).(Validation.Errors)[0].ErrorContent}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>